package com.ht.base.system.biz.client.impl;

import com.ht.base.system.biz.manager.SysUserRoleManager;
import com.ht.base.system.client.SysUserRoleClient;
import com.ht.base.system.common.pojo.bo.SysUserRoleBO;
import org.base.common.appexception.AppException;
import org.base.common.appexception.ResultData;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @Author hdengxian
 * @Date 2023/8/15 17:30
 */
@DubboService
@Component
public class SysUserRoleClientImpl implements SysUserRoleClient {

    @Resource
    private SysUserRoleManager sysUserRoleManager;

    @Override
    public ResultData<SysUserRoleBO> findByUserId(Long sysUserId) {
        return new ResultData<>(sysUserRoleManager.findByUserId(sysUserId));
    }

    @Override
    public ResultData<Boolean> addUserRoleRelation(SysUserRoleBO relation) throws AppException {
        return new ResultData<>(sysUserRoleManager.addUserRoleRelation(relation));
    }

    @Override
    public ResultData<Boolean> delRelation() {
        return new ResultData<>(sysUserRoleManager.delRelation());
    }
}
